Cosmetics
authorMatthias Clasen <mclasen@redhat.com>
Sun, 25 Oct 2020 01:35:35 +0000 (21:35 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 25 Oct 2020 01:35:35 +0000 (21:35 -0400)
Make gtk_at_spi_root_child_changed take a
GtkAccessible for the child.

gtk/a11y/gtkatspiroot.c
gtk/a11y/gtkatspirootprivate.h

index a68d9cac4020435dde390c3b171897145c0ae1c4..9aec9af186952cf4804969cf3b74720755c9f00a 100644 (file)
@@ -408,7 +408,7 @@ static const GDBusInterfaceVTable root_accessible_vtable = {
 void
 gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
                                GtkAccessibleChildState   state,
-                               GtkWidget                *window)
+                               GtkAccessible            *child)
 {
   guint n, i;
   int idx = 0;
@@ -417,18 +417,13 @@ gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
   if (!self->toplevels)
     return;
 
-  /* We can be called either with a valid position and window == NULL
-   * or with position == G_MAXUINT and a valid window. In both cases,
-   * we need to determine the index of where the removed object would
-   * have been in the accessible tree.
-   */
   for (i = 0, n = g_list_model_get_n_items (self->toplevels); i < n; i++)
     {
       GtkAccessible *item = g_list_model_get_item (self->toplevels, i);
 
       g_object_unref (item);
 
-      if (item == GTK_ACCESSIBLE (window))
+      if (item == child)
         break;
 
       if (!gtk_accessible_should_present (item))
@@ -437,13 +432,13 @@ gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
       idx++;
     }
 
-  if (window == NULL)
+  if (child == NULL)
     {
       window_ref = gtk_at_spi_null_ref ();
     }
   else
     {
-      GtkATContext *context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (window));
+      GtkATContext *context = gtk_accessible_get_at_context (child);
 
       window_ref = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (context));
     }
index 7f4f062afcddc41f1a4e5897215d5c345fe9037f..c4046c35e5dad756b947b6672b2fd89af2204fc6 100644 (file)
@@ -45,6 +45,6 @@ gtk_at_spi_root_to_ref (GtkAtSpiRoot *self);
 void
 gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
                                GtkAccessibleChildState   state,
-                               GtkWidget                *window);
+                               GtkAccessible            *child);
 
 G_END_DECLS